const arr = [1, {}, {}, 1, { name: 'bob' }, 1, { name: 'bob' }];
let obj = {};
let newArr = arr.filter(function(item, index, arr) {
    return obj.hasOwnProperty(typeof item + item) ? false : (obj[typeof item + item] = true)
})
console.log(newArr)